export default {
  namespaced: true,
  state: {
    username: 'jack',
    userId: '1',
    token: 'cnjsakbnclzsn'
  },
  mutations: {
    login(state, user) {
      state.username = user.username;
      state.userId = user.userId;
      state.token = user.token;
    },
    logout(state) {
      state.username = '';
      state.userId = '';
      state.token = '';
    }
  },
  actions: {
    loginApi({ commit }) {
      setTimeout(() => {
        commit('login')
      })
    }
  },
  getters: {}
}